package com.chang.cheng.toutiaoserver.login.service.impl;

import com.chang.cheng.toutiaoserver.login.service.ApUserGetChannelsService;
import com.chang.cheng.toutiaoserver.model.common.dtos.ResponseResult;
import com.chang.cheng.toutiaoserver.model.user.pojos.Channel;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Auther: asus
 * @Date: 2022/01/06 06:39
 * @Description:
 */
@Service
public class ApUserGetChannelsServiceImpl implements ApUserGetChannelsService {

    @Override
    public ResponseResult getChannels() {
        Map<String, Object> map = new HashMap<>();
        List<Channel> list=new ArrayList<>();
        Channel channel=new Channel();
        channel.setId(0L);
        channel.setName("推荐");
        list.add(channel);
        Channel channel1=new Channel();
        channel1.setId(4L);
        channel1.setName("c++");
        list.add(channel1);
        Channel channel2=new Channel();
        channel2.setId(1L);
        channel2.setName("java");
        list.add(channel2);
        Channel channel3=new Channel();
        channel3.setId(3L);
        channel3.setName("vue");
        list.add(channel3);
        Channel channel4=new Channel();
        channel4.setId(2L);
        channel4.setName("mysql");
        list.add(channel4);
        Channel channel5=new Channel();
        channel5.setId(6L);
        channel5.setName("大数据");
        list.add(channel5);
        map.put("channels", list);

        return ResponseResult.okResult(map);
    }
}
